<div class="mbProduct">
<div class="mbTopClose"><a id="mbCloseLink" href="javascript:Mediabox.close()"></a></div>
<div class="mbInner">
<?php 
$id = $data[0]['p']['g_id'];
$info = $data[0]['p'];
$detail = $data[0]['p']['g_description'];
@$sp_detail = $data[0]['p']['g_special_html'];
$notice_detail = empty($data[0]['p']['g_notice_html'])?'':$data[0]['p']['g_notice_html'];
$price = $data[0]['p']['g_jiazhi'];
$img = $data[0]['p']['g_img'];
$name = $data[0]['p']['g_name'];
$p_url = $data[0]['p']['g_protal_url'];
$is_in_list = $data[0]['p']['in_list'];
if (!empty($p_url) && !strstr($p_url,'http://')){
	$p_url = 'http://'.$p_url;
}


/* 积分兑换*/
$exchanges = empty($data[0]['p']['g_exchanges'])?0:$data[0]['p']['g_exchanges'];
$exchanges_gold = empty($data[0]['p']['g_exchanges_gold'])?0:$data[0]['p']['g_exchanges_gold'];
$g_number = $data[0]['p']['g_number'];
@$g_lucknum = $data[0]['p']['g_lucknum'];

/* 产品试用*/
$product_price = $data[0]['p']['g_price'];
@$popularity = $data[0]['p']['popularity'];
@$rand = $data[0]['p']['rand'];

@$is_ad_link = intval($data[0]['p']['is_ad_link']);
@$is_coupon_show = intval($data[0]['p']['is_coupon_show']);

$keys = SystemProperties::$img_names;
$product_img = array();
for ($i=1;$i<count($keys);$i++){
	$product_img[] = empty($data[0]['p'][$keys[$i]])?
	'':
	SystemProperties::$app_upload_img_host.$data[0]['p'][$keys[$i]];
}

?>
<div class="product_content"><form name="fms" action="" method="post" id="fms"><input name="data[id]" value="<?=$id?>" id="id" type="hidden"><input name="data[extra]" value="" id="data_extra_id" type="hidden"><input name="sendweibo" value="" id="input_sendweibo" type="hidden"></form>
<?php 
if (!empty($product_img[0])){
?>
	<div class="l"><div><img onclick="showNextPic()" id="productImgId" border="0" width="225" height="225" src="<?=$product_img[0]?>" /></div><div class="piclist">
	<?php 
	foreach ($product_img as $n=>$pimg){
		if (!empty($pimg)){
			echo '<a style="display:none" href="javascript:changeImg('.$n.')"><img id="PicSL_'.$n.'" src="'.$pimg.'" border="0" style="border:1px solid #888;margin:1px;" width="48" height="48"/></a>';
		}
	}
	?>
	</div></div>
	<?php } ?>

	<div class="r"><?=$detail?><br /></div>
	</div>
	
<div class="applyinfo" style="width:634px;padding-top:7px;height:190px;overflow:hidden;padding-left:0px;">
<?php 
// 免费申请
if(isset($popularity)){ 
    $type = 1;
    
    if (!$is_in_list || $g_number<=0) { 
        $noapply = 1 ;
    } else {
        $noapply = 0;
    }
        
    ?>
<script type="text/javascript">
function applytab_change(id) {
    idelse = 3 - id;
    $('applytab_bt_1').removeClass('applytab_bt_x');
    $('applytab_bt_2').removeClass('applytab_bt_x');
    $('applytab_bt_1').removeClass('applytab_bt_now');
    $('applytab_bt_2').removeClass('applytab_bt_now');
    $('applytab_bt_'+id).addClass('applytab_bt_now');
    $('applytab_bt_'+idelse).addClass('applytab_bt_x');
    
    $('applytab_info_'+id).setStyle('display','');
    $('applytab_'+id).setStyle('display','');
    $('applytab_info_'+idelse).setStyle('display','none');
    $('applytab_'+idelse).setStyle('display','none');
}
</script>
<div class="applytab">
<?php if (!$noapply) { ?>
    <span id="applytab_bt_1" class="applytab_bt_now" onclick="applytab_change(1)">注意事项</span>
    <span id="applytab_bt_2" class="applytab_bt_x" onclick="applytab_change(2)">申请详情</span>
    <span id="applytab_info_1">市场价：<b class='rmb'><?=$price?>元</b> &nbsp;&nbsp;&nbsp;
    总:<b style="color:blue"><?=($info['type']=='coupon')?'若干':($info['g_number'] + $info['g_sent'])?></b>份
	&nbsp;&nbsp;
	已送:<b style="color:blue"><?=$info['g_sent']?></b>份
    </span>
    <span id="applytab_info_2" style="display:none">
    截止目前，共有<b style="color:blue"><?=$total_apply?></b>人参与赚宝，<b style="color:blue"><?=$total_luck?></b>名玩家赚宝成功。
    </span>
    
<?php } else { ?>
    <span id="applytab_bt_2" class="applytab_bt_now" onclick="applytab_change(2)">申请详情</span>
    <span id="applytab_info_2">
    截止目前，共有<b style="color:blue"><?=$total_apply?></b>人参与赚宝，<b style="color:blue"><?=$total_luck?></b>名玩家赚宝成功。
    </span>    
<?php } ?>


</div>
<div style="height:161px;width:634px;overflow:hidden">
    <div id="applytab_1" class="box_round_big" style="<?=$noapply?'display:none':''?>">
    <div style="height:144px;padding:8px 12px;width:609px;overflow-y:auto;">
        <div><?=$notice_detail?></div>
        <div><?=$sp_detail?></div>
    </div>
    </div>
    <div id="applytab_2">
        <div style="width:300px;float:left;">
            <div>
                <table width="300" cellpadding="0" cellspacing="0" style="background:#b4d7f5"><tr>
                <td>申请玩家</td><td width="125">申请时间</td>
                </tr></table>
            </div>
            <div class="list_user_div">
                <table cellpadding="0" cellspacing="0" >
                <?php 
                foreach ($list_apply_user as $da) { ?>
                    <tr><td><?=$da['g_users']['g_name']?></td><td width="125"><?=date('Y-m-d H:i:s',strtotime($da['g_timesplit_logs']['time']))?></td></tr>
                <?php } ?>
                </table>
            </div>
        </div>
        <div style="width:300px;float:right;">
            <div>
                <table width="300" cellpadding="0" cellspacing="0" style="background:#f2a09f"><tr>
                <td>得宝玩家</td>
                <td width="125">申请时间</td>
                </tr></table>
            </div>
            <div class="list_user_div">
                <table cellpadding="0" cellspacing="0" >
                <?php foreach ($list_luck_user as $da){ ?>
                    <tr><td><?=$da['g_users']['g_name']?></td><td width="125"><?=date('Y-m-d H:i:s',strtotime($da['g_lucks']['time']))?></td></tr>
                <?php } ?>
                </table>            
            </div>
        </div>
    </div>
</div>
<?php } ?>

<?php 
// 积分兑换
if((isset($exchanges)&&$exchanges>0) || (isset($exchanges_gold)&&$exchanges_gold>0))	{ 
    $type = 2;
    ?>
<div class="applytab" style="border-bottom:2px solid #005aa3;">
    <span id="applytab_bt_1" class="applytab_bt_now">换宝详情</span>
    共有<b style="color:blue"><?=$g_number+$total_luck?></b>份宝贝，截至目前<b style="color:blue"><?=$total_luck?></b>名玩家参与换宝。
</div>
<div style="height:210px;width:625px;overflow:hidden">
<div class="change_info_box">
    宝贝兑换
	<?php if ($exchanges>0) { ?>
	    需要积分：<b class='rmb'><?=$exchanges?></b>
	<?php } else if ($exchanges_gold>0) {?>
	    需要<b class='rmb'>金币</b>：<b class='rmb'><?=$exchanges_gold?></b>
	<?php } ?>
</div>
        <div style="width:300px;float:right;">
            <div>
                <table width="300" cellpadding="0" cellspacing="0" style="background:#b4d7f5"><tr>
                <td>换宝玩家</td>
                <td width="125">申请时间</td>
                </tr></table>
            </div>
            <div class="list_user_div">
                <table cellpadding="0" cellspacing="0" >
                <?php foreach ($list_luck_user as $da){ ?>
                    <tr><td><?=$da['g_users']['g_name']?></td><td width="125"><?=date('Y-m-d H:i:s',strtotime($da['g_lucks']['time']))?></td></tr>
                <?php } ?>
                </table>            
            </div>
        </div>
</div>
<?php } ?>
</div>

<div class="applybt">
<?php 
if ($is_in_list && $g_number>0) {    
    if ($is_ad_link == 1) { 
		 
		// cy add, 20110317
		if (empty($_GET['cyaparam'])){
			$cy_url_from = '';
		} else {
			$cy_url_from = '?cyaparam='.trim($_GET['cyaparam']);
		}


        //广告商品
        //echo '<div id="myConvertBy" class="myConvertBy" style="padding-left:250px">';
		//echo '<a  onclick="javascript:return tryOperatorzxWithoutPost(1);" target="_blank" href="'.SystemProperties::$app_host.'/product/goProductLink/'.$id.$cy_url_from.'"><img src="'.SystemProperties::$path.'/image/new/apply.png"  border="0" /></a>';
		//echo '</div>';


		echo '<div id="myConvertBy" class="myConvertBy">';
			echo '<div style="float:left;line-height:40px;width:250px;">';

			// cy add, 2011-7-19
			$platform_ctl = PlatformBase::get_instance();
			echo $platform_ctl->html_detail_show_send_weibo($id);
			// cy add end, 2011-7-19

			echo '&nbsp;</div>';
			echo '<div style="float:left;">';
			$click_url = SystemProperties::$app_host.'/product/goProductLink/'.$id.$cy_url_from;
			$img_src = SystemProperties::$path.'/image/new/apply.png';
			echo <<<EOT
			<a  onclick="javascript:return tryOperatorzxWithoutPost(1, '$click_url');" ><img src="$img_src"  border="0" /></a>
EOT;
			//echo '<a  onclick="javascript:return tryOperatorzxWithoutPost(1, "'.SystemProperties::$app_host.'/product/goProductLink/'.$id.$cy_url_from.'");" target="_blank" href="'.SystemProperties::$app_host.'/product/goProductLink/'.$id.$cy_url_from.'"><img src="'.SystemProperties::$path.'/image/new/apply.png"  border="0" /></a>';
			echo '</div>';
		echo '</div>';



    } else {
    
 		echo '<div id="myConvertDoing" style="display:none;float:left">'.(isset($popularity)?'请稍等，正在启动开心赚轮...':'请稍等...').'</div>';
		echo '<div id="myConvertInfo" style="line-height:40px;width:350px;display:none;color:red;float:left"></div>';
		echo '<div id="myConvertInfoView" style="line-height:40px;width:130px;display:none;color:red;float:left"><a href="javascript:goMyluck('.($is_coupon_show?'1':'2').');Mediabox.close();"><img src="'.SystemProperties::$path.'/image/new/view.png'.'" /></a></div>';
		echo '<div id="myConvertBy" class="myConvertBy">';
		echo '<div style="float:left;line-height:40px;width:250px;">';

		$platform_ctl = PlatformBase::get_instance();
		echo $platform_ctl->html_detail_show_send_weibo($id);

		echo '&nbsp;</div>';
		echo '<div style="float:left;"><a href="javascript:tryOperatorzx('.$type.');"><img src="'.SystemProperties::$path.'/image/new/apply'.(isset($popularity)?'':'change').'.png'.'"  border="0" /></a></div>';
		echo '</div>';
		echo '</div>';
    }
} else {
   
}
?>
</div>

<div id="cyFillInfo_p" style="background: white; position:absolute;top: 13px; width:600px; height:635px; padding:50px; display:none">
<div id="cyFillInfo" ></div>
</div>

<div class="flash" id="flashcon" style="display:none; "><div id="flashcon_t"></div></div>

</div>
</div>

<script type="text/javascript">
var nowpic = 0;
var nowpic_timer = 0;
nowpic_timer = setInterval(showNextPic,2500);
</script>
